<?php
$config = Zend_Registry::get("config");
?>
<div class="centerbig_modal_form">
      <!-- error message -->
      <input type="hidden" id="isEmpty" value="<?php echo $this->translate("isEmpty"); ?>">
      <input type="hidden" id="stringLengthTooLong" value="<?php echo $this->translate("stringLengthTooLong"); ?>">
      <!-- error message -->
      <div class="center_top">
          <span class="center_top_title"><?php echo $this->translate("addCategoryTitle"); ?></span>
          <div class='centerbig_modal_btn_div' onclick='javascript:Common.closeDialog("categoryDialog");'>
            <div class='center_form_btn_pic'>
                <img src='<?php echo HttpUtil::baseUrl();?>/images/cancel.gif'/>
            </div><div class='center_form_btn_text'><?php echo $this->translate("cancelBtn"); ?></div>
          </div>
          <div class='centerbig_modal_btn_div' onclick='javascript:Inventory.addCategory("<?php echo HttpUtil::baseUrl();?>");'>
            <div class='center_form_btn_pic'>
                <img src='<?php echo HttpUtil::baseUrl();?>/images/save.gif'/>
            </div><div class='center_form_btn_text'><?php echo $this->translate("saveBtn"); ?></div>
          </div>
      </div>
      <div class="centerbig_modal_content">
            <form action="<?php echo $this->form->getAction(); ?>" method="post" id="addCategory">
            <div class="centerbig_right">
               <div class="form_content">
                        <?php ZendFormUtil::renderElement($this->form->shortName); ?>
                        <?php ZendFormUtil::renderElement($this->form->fullName); ?>
                        <?php ZendFormUtil::renderElement($this->form->sortOrder); ?>
                        <?php ZendFormUtil::renderElement($this->form->urlTitle,"","http://www." . $config->domain ."/c/<span id='urlTitleMsgLabel'></span>"); ?>
                        <?php ZendFormUtil::renderElement($this->form->seoTitle); ?>
                        <?php ZendFormUtil::renderElement($this->form->seoKeyWord); ?>
                        <?php ZendFormUtil::renderElement($this->form->visible); ?>
                        <?php ZendFormUtil::renderElement($this->form->metadataSet); ?>
                        <?php ZendFormUtil::renderElement($this->form->priceSection); ?>
                        <?php ZendFormUtil::renderElement($this->form->seoDescription); ?>
                        <?php echo $this->form->parent; ?>
                        <div class="form_line_div">
                            <div class="form_element_label"><?php echo $this->translate("parentCategory"); ?></div>
                            <div class="form_element">
                                <div style="margin:5px 0; color:#acc3d5;" id="treeboxbox_tree_add">

                                </div>
                            </div>
                        </div>
                        <div class='clear'></div>
                        <div class="form_line_div">
                            <div id="parentErrorLabel" class="form_element_label"></div>
                            <div id="parentError" class="form_element_error"></div>
                        </div>
               </div>
            </div>
            </form>
      </div>
      <div class='clear'></div>
</div>
<div class='clear'></div>
<script type="text/javascript" language="javascript">
    //<![CDATA[
         var tree;
         //$(document).ready(function(){
            var checkId = "<?php echo $this->parentId; ?>";
            var categoryXml = '<?php echo $this->categoryXml ?>';
            var imagePath = "<?php echo HttpUtil::baseUrl();?>/images/dhtmltreeimgs/";
            var tree = Inventory.initCategoryTree("treeboxbox_tree_add",categoryXml,imagePath,1);
            tree.enableTreeImages(0);
            tree.enableThreeStateCheckboxes(0);
            tree.setOnCheckHandler(Inventory.selectCheckBox);
            tree.openAllItems("-1");
            tree.setCheck(checkId,1);
         //});
     //]]>
</script>
